<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%
      String path = request.getContextPath();
    %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>登录</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="css/sign-up-login.css">
<link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/font-awesome/4.6.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/inputEffect.css" />
<link rel="stylesheet" href="css/tooltips.css" />
<link rel="stylesheet" href="css/spop.min.css" />

<script src="js/jquery.min.js"></script>
<script src="js/snow.js"></script>
<script src="js/jquery.pure.tooltips.js"></script>
<script src="js/spop.min.js"></script>
<!-- <script type="text/javascript" src="<%=path %>/index/js/jquery-3.3.1.min.js"></script> -->
 
<script>	

	(function() {
		// trim polyfill : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
		if (!String.prototype.trim) {
			(function() {
				// Make sure we trim BOM and NBSP
				var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
				String.prototype.trim = function() {
					return this.replace(rtrim, '');
				};
			})();
		}

		[].slice.call( document.querySelectorAll( 'input.input__field' ) ).forEach( function( inputEl ) {
			// in case the input is already filled..
			if( inputEl.value.trim() !== '' ) {
				classie.add( inputEl.parentNode, 'input--filled' );
			}

			// events:
			inputEl.addEventListener( 'focus', onInputFocus );
			inputEl.addEventListener( 'blur', onInputBlur );
		} );

		function onInputFocus( ev ) {
			classie.add( ev.target.parentNode, 'input--filled' );
		}

		function onInputBlur( ev ) {
			if( ev.target.value.trim() === '' ) {
				classie.remove( ev.target.parentNode, 'input--filled' );
			}
		}
	})();
	
	
	
	$(function() {	
		$('#login #login-password').focus(function() {
			$('.login-owl').addClass('password');
		}).blur(function() {
			$('.login-owl').removeClass('password');
		});
		$('#login #register-password').focus(function() {
			$('.register-owl').addClass('password');
		}).blur(function() {
			$('.register-owl').removeClass('password');
		});
		$('#login #register-repassword').focus(function() {
			$('.register-owl').addClass('password');
		}).blur(function() {
			$('.register-owl').removeClass('password');
		});
		$('#login #forget-password').focus(function() {
			$('.forget-owl').addClass('password');
		}).blur(function() {
			$('.forget-owl').removeClass('password');
		});
	});
	
	function goto_register(){
		$("#register-username").val("");
		$("#register-password").val("");
		$("#register-repassword").val("");
		$("#register-code").val("");
		$("#tab-2").prop("checked",true);
	}
	
	function goto_login(){
		$("#login-username").val("");
		$("#login-password").val("");
		$("#tab-1").prop("checked",true);
	}
	
	function goto_forget(){
		$("#forget-username").val("");
		$("#forget-password").val("");
		$("#forget-code").val("");
		$("#tab-3").prop("checked",true);
	}
	
	
	
	//登录start
	

	
	function login(){//登录
		var username = $("#login-username").val();
		var password = $("#login-password").val();
		var	flagname = true;
		var	flagpass = true;
		var flagcode = true;
			
	
		//1.判断密码
		if(password == ""){//如果密码是空
			$.pt({
        		target: $("#login-password"),
        		position: 'r',
        		align: 't',
        		width: 'auto',
        		height: 'auto',
        		content:"密码不能为空"
        		
        	});
			flagpass = false;
		}
		else
		{
			//密码必须为6-12位的字母或数字
			var regExp = new RegExp("^[a-zA-Z0-9_]{6,12}$");
			if(!regExp.test(password)){//如果密码不符合6-12位
				$.pt({
	        		target: $("#login-password"),
	        		position: 'r',
	        		align: 't',
	        		width: 'auto',
	        		height: 'auto',
	        		content:"密码必须为6-12位的字母或数字"
	        	});
				flagpass = false;
			}
		}
			
			
			
		//2.判断用户名
		if(username == ""){//如果用户名是空
			$.pt({
        		target: $("#login-username"),
        		position: 'r',
        		align: 't',
        		width: 'auto',
        		height: 'auto',
        		content:"用户名不能为空"
        	});
			flagname = false;
		}
		else//如果用户名不为空：
		{
			//用户名必须为6-15位的字母或数字
			var regExp = new RegExp("^[a-zA-Z0-9_]{6,15}$");
			if(!regExp.test(username)){//如果用户名不符合6-15位
				$.pt({
	        		target: $("#login-username"),
	        		position: 'r',
	        		align: 't',
	        		width: 'auto',
	        		height: 'auto',
	        		content:"用户名必须为6-15位的字母或数字"
	        	});
				//flagpass615 = false;
				flagname = false;
			}
			
		}
		
        //3.验证码
        var wv = $("#inputCheckCode").attr("v");
        if(wv!="yes")
        {
        	var flagcode = false;
        }
        	
        
        
		
		if(flagname&&flagpass&&flagcode)//如果都符合
		{
			return true;//如果符合，返回true
		}
		else
		{
			return false;//如果不符合，返回false
		}
	}
	
	$(document).ready(function(){
		$("#LogIn").submit(login);
	});
	//登录end
	
	
	
	//注册start

	

	//1.判断密码
	function toCheckPassword(){
		var password = $("#register-password").val();//获取密码的值
		var	repassword = $("#register-repassword").val();//获取再次输入密码的值
		var passflag = true;//关于密码的布尔值
		
		if(password == ""){//如果密码为空
			$.pt({
        		target: $("#register-password"),
        		position: 'r',
        		align: 't',
        		width: 'auto',
        		height: 'auto',
        		content:"密码不能为空"
        	});
			passflag = false;//密码为空，不能注册！
		}
		
		else{//如果不为空
			//密码必须为6-12位的字母或数字
			var regExp = new RegExp("^[a-zA-Z0-9_]{6,12}$");
			if(!regExp.test(password)){
				$.pt({
	        		target: $("#register-password"),
	        		position: 'r',
	        		align: 't',
	        		width: 'auto',
	        		height: 'auto',
	        		content:"密码必须6-12位数字、字母"
	        	});
				passflag = false;//如果不符合6-12位，不能注册！
			}
			
			if(password != repassword&&repassword!=""){
				$.pt({
	        		target: $("#register-repassword"),
	        		position: 'r',
	        		align: 't',
	        		width: 'auto',
	        		height: 'auto',
	        		content:"密码需一致"
	        	});
				passflag = false;//两次输入不一致，不能注册！
			}
		}
		return passflag;
	}
		
		
			
	//2.判断用户名
	function toCheckPassname(){
		var username = $("#register-username").val();
		var nameflag = true;//2关于用户名的布尔值
			
		$("#chongfu").html("");
		if(username == ""){//如果用户名为空
			$.pt({
        		target: $("#register-username"),
        		position: 'r',
        		align: 't',
        		width: 'auto',
        		height: 'auto',
        		content:"用户名不能为空"
        	});
			nameflag = false;//如果用户名是空的，不能注册！
		}
		else//如果不为空
		{
			var regExp = new RegExp("^[a-zA-Z0-9_]{6,15}$");
			if(!regExp.test(username)){
				$.pt({
	        		target: $("#register-username"),
	        		position: 'r',
	        		align: 't',
	        		width: 'auto',
	        		height: 'auto',
	        		content:"用户名必须为6-15位的字母或数字"
	        	});
				nameflag = false;//如果用户名不符合6-15位，不能注册！
			}
			else//符合正则表达式
			{
				//判断用户名是否重复
				$.ajax({
					url:"<%=path%>/RegisterServlet",
					type:"post",
					async:false,
					data:"method=toCheckUsername&username="+username,
					success:function(mes){
						if(mes=="1")//重复
						{
							$("#chongfu").html("用户名重复");
							$("#chongfu").css("color","red");
							nameflag = false;
							
						}
						if(mes=="0")//没有重复
						{
							$("#chongfu").html("");
						}
						
					}
				})
			}
			
		}
		return nameflag;
	}
		
		
       
	//3.判断姓名、昵称、密保答案等
	function toCheckInfo(){
		var reqflag = true;//3关于必选项是否填写的布尔值	
		
		var realname = $("#realname").val();
		var phonenumber = $("#phonenumber").val();
		var nickname = $("#nickname").val();
		var answerQuestion = $("#answerQuestion").val();
		if(realname==""||phonenumber==""||nickname==""||answerQuestion=="")
		{
			reqflag = false;//一旦有一项没填，不能注册
			$("#tianxie").html("必填项务必要全部填写");
			$("#tianxie").css("color","red");
		}
		else
		{
			$("#tianxie").html("");
		}
		return reqflag;
	}
	
	//4.判断验证码
	function toCheckCode()
	{
		var codeflag = true;
		var v = $("#inputCheckCode2").attr("v");
		if(v!="yes")
		{
			codeflag = false;
		}
		return codeflag;
	}
	
	
	function check()
	{
		var pflag = toCheckPassword();//密码
		var nflag = toCheckPassname();//用户名
		var infoflag = toCheckInfo();//用户信息
		var checkcodeflag = toCheckCode();//验证码
		
		return pflag&&nflag&&infoflag&&checkcodeflag;
	}
		
		
	
	
	$(document).ready(function(){
  	  $("#regis").submit(check);
    })

	//注册end
	
	
	
	//忘记密码start
		
		var avaiUsername="";
	
	    $(document).ready(function(){
	  	    $("#forgotpasword").submit(toLookFor);
	    });
	    function toLookFor()
	    {
	    	
		    var flag1 = toCheckPassnameForget();//用户名
		    var flag2 = toCheckPasswordForget();//密码
		    var flag3 = toCheckAnswer();//密保答案
		    
		    return flag1&&flag2&&flag3;
	    }
	   
		//1.判断用户名
		function toCheckPassnameForget(){
			var username = $("#forget-username").val();
			var pnflag = true;//用户名
			
			if(username == ""){//如果用户名为空
				$.pt({
	        		target: $("#forget-username"),
	        		position: 'r',
	        		align: 't',
	        		width: 'auto',
	        		height: 'auto',
	        		content:"用户名不能为空"
	        	});
				pnflag = false;
			}
			else//如果用户名不为空
			{
				//用户名只能是6-15位以下的字母或数字
				var regExp = new RegExp("^[a-zA-Z0-9_]{6,15}$");
				if(!regExp.test(username)){
					$.pt({
		        		target: $("#forget-username"),
		        		position: 'r',
		        		align: 't',
		        		width: 'auto',
		        		height: 'auto',
		        		content:"用户名必须为6-15位的字母或数字"
		        	});
					pnflag = false;
				}
				else//符合正则表达式，去数据库读密保问题
				{
					$.ajax({
						url:"<%=path%>/LookForPasswordServlet",
						type:"post",
						data:"method=toLookForPassword&username="+username,
						success:function(mes){
							if(mes=="no")//表示用户名不存在
							{
								$("#questionspan").html("用户名不存在");
							}
							else//存在
							{
								$("#questionspan").html(mes);
								avaiUsername = username;
								
							}
							
						}
					})
				}
			}
			return pnflag;
		}
		
		
		//2.判断密码
		function toCheckPasswordForget(){
			var password = $("#forget-password").val();
			var pwflag = true;//密码
			
			if(password == ""){
				$.pt({
	        		target: $("#forget-password"),
	        		position: 'r',
	        		align: 't',
	        		width: 'auto',
	        		height: 'auto',
	        		content:"密码不能为空"
	        	});
				pwflag = false;
			}
			else
			{
				//密码只能是6-12位的字母或数字
				var regExp = new RegExp("^[a-zA-Z0-9_]{6,12}$");
				if(!regExp.test(password)){
					$.pt({
		        		target: $("#forget-password"),
		        		position: 'r',
		        		align: 't',
		        		width: 'auto',
		        		height: 'auto',
		        		content:"密码必须是6-12位数字字母"
		        	});
					pwflag = false;
				}
			}
			return pwflag;
		}
		
		
		//3.判断密保问题
		function toCheckAnswer()
		{
			var answerinput = $("#answerinput").val();
			var answerflag = true;//密保问题
			var q = "";
			
			if(answerinput!="" && avaiUsername!="")
			{
				$.ajax({
					url:"<%=path%>/LookForPasswordServlet",
					type:"post",
					async:false,
					data:"method=toCheckAnswer&answer="+answerinput+"&name="+avaiUsername,
					success:function(mes){
						if(mes=="false")
						{
							
							answerflag = false;
							$("#yesorno").html("问题错误");
							$("#yesorno").css("color","red");
						}
						if(mes=="true")
						{
							answerflag = true;
							$("#yesorno").html("");
							//$("#yesorno").css("color","green");
						}
						
					}
				});
				
			}
			else
			{
				answerflag = false;
			}
			
			return answerflag;
		}

	//忘记密码end
	
</script> 

<script>
    function xianShi(){
    	$("#showMore").css("display","block");
    	
    }
    function yinCang(){
    	$("#showMore").css("display","none");
    }
</script>

<style type="text/css">
html{width: 100%; height: 100%;}

body{

	background-repeat: no-repeat;

	background-position: center center #2D0F0F;

	background-color: #00BDDC;

	background-image: url(images/snow.jpg);

	background-size: 100% 100%;

}

.snow-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100001; }

</style>
</head>
<body>
	<!-- 雪花背景 -->
	<div class="snow-container"></div>
	<!-- 登录控件 -->
	<div id="login">
		<input id="tab-1" type="radio" name="tab" class="sign-in hidden" checked />
		<input id="tab-2" type="radio" name="tab" class="sign-up hidden" />
		<input id="tab-3" type="radio" name="tab" class="sign-out hidden" />
		<div class="wrapper">
		
		
		
			<!-- 登录页面 -->
			
			<div class="login sign-in-htm">
				<form class="container offset1 loginform" id="LogIn" method="post" action="<%=path%>/LoginServlet?method=toLogin">
					<!-- 猫头鹰控件 -->
					<div id="owl-login" class="login-owl">
						<div class="hand"></div>
						<div class="hand hand-r"></div>
						<div class="arms">
							<div class="arm"></div>
							<div class="arm arm-r"></div>
						</div>
					</div>
					
					<%
			            String w = request.getParameter("w");
			            if("1".equals(w))
			            {
				             out.print("<font style='color:green;font-size:20px;'>注册成功！请登录</font>");
			            }
                     %>
                     
                     <%
			            String z = request.getParameter("z");
			            if("1".equals(z))
			            {
				             out.print("<font style='color:green;font-size:20px;'>重置密码成功！请登录</font>");
			            }
                     %>
                     <%
                        String rev = request.getParameter("rev");
                        if("1".equals(rev))
                        {
                        	out.print("<font style='color:green;font-size:20px;'>密码重置成功！请登录</font>");
                        }
                     %>
					
					<div class="pad input-container">
						<!-- <section class="content"> -->
							<span class="input input--hideo">
								<input class="input__field input__field--hideo" type="text" id="login-username" name="login-username" 
									autocomplete="off" placeholder="请输入用户名" tabindex="1" maxlength="15" onkeyup="login()" />
								<label class="input__label input__label--hideo" for="login-username">
									<i class="fa fa-fw fa-user icon icon--hideo"></i>
									<span class="input__label-content input__label-content--hideo"></span>
								</label>
							</span>
							<span class="input input--hideo">
								<input class="input__field input__field--hideo" type="password" id="login-password" name="login-password" placeholder="请输入密码" tabindex="2" maxlength="15" onkeyup="login()"/>
								<label class="input__label input__label--hideo" for="login-password">
									<i class="fa fa-fw fa-lock icon icon--hideo"></i>
									<span class="input__label-content input__label-content--hideo"></span>
								</label>
							</span>
							
					<%
			            String x = request.getParameter("x");
			            if("1".equals(x))
			            {
				             out.print("<font color='red'>用户名或者密码输入错误</font>");
			            }
                     %><br>
                            <span>
							     验证码：<input type="text" name="checkCode" id="inputCheckCode" v="" maxlength="4" onkeyup="toCheckTheCode()"><span></span>
							  <img id="thecode" src="<%=path%>/CheckCodeServlet?method=createCheckCode"><br>
							  <a href="javascript:void(0);" id="changeCode" onclick="toChangeCheckcode()">换一张</a><br>
							  
							  
							  <script type="text/javascript">
							  <!-- 换一张验证码 -->
							  function toChangeCheckcode()
							  {
							    		   var m = Math.random();
							    		 //当点击“换一张”，更换验证码图片
							    		 $("#thecode").attr("src","<%=path%>/CheckCodeServlet?method=createCheckCode&x="+m);
							  }
							  </script>
							  
							  <!-- 判断输入的验证码与图片中的验证码是否相同 -->
                              <script type="text/javascript">
                              function toCheckTheCode()
                              {
                            	  $("#inputCheckCode").attr("v","");
                                		  //验证码输入不足四位的时候，不判断
                                   		  if($("#inputCheckCode").val().length<4)
                                		  {
                                   			
                                			return;
                                		  }
                                   		
                                   		  var y = $("#inputCheckCode").val();//获得文本框中输入的内容
                                   		
                                   		  $.ajax({
                                   			  url:"<%=path %>/CheckCodeServlet",
                                   			  type:"post",
                                   			  data:"method=check&inputcode="+y,
                                   			  success:function(mes){
                                   				if(mes=="yes")
                                				{
                                					$("#inputCheckCode").next().html("验证码输入正确");
                                					$("#inputCheckCode").next().css("color","green");
                                					$("#inputCheckCode").attr("v","yes");
                                				}
                                				if(mes=="no")
                                				{
                                					$("#inputCheckCode").next().html("验证码输入错误");
                                					$("#inputCheckCode").next().css("color","red");
                                					
                                				}
                                   			  }
                                   		  })
                              }
                              </script>
							</span>
                    
						<!-- </section> -->
					</div>
					
					<div class="form-actions">
						<a tabindex="4" class="btn pull-left btn-link text-muted" onClick="goto_forget()">忘记密码?</a>
						<a tabindex="5" class="btn btn-link text-muted" onClick="goto_register()">注册</a>
						<input class="btn btn-primary" type="submit" tabindex="3" onClick="login()" value="登录" 
							style="color:white;"/>
					</div>
				</form>
			</div>
			
			
			
			<!-- 忘记密码页面 -->
			<div class="login sign-out-htm">
				<form  method="post" class="container offset1 loginform" id="forgotpasword"  method="post" 
				action="<%=path %>/LookForPasswordServlet?method=toChangePassword" >
					<!-- 猫头鹰控件 -->
					<div id="owl-login" class="forget-owl">
						<div class="hand"></div>
						<div class="hand hand-r"></div>
						<div class="arms">
							<div class="arm"></div>
							<div class="arm arm-r"></div>
						</div>
					</div>
					
					<div class="pad input-container">
						<section class="content">
							<span class="input input--hideo">
								<input name="pleaseUsername" class="input__field input__field--hideo" type="text" id="forget-username" autocomplete="off" onblur="toCheckPassnameForget()" placeholder="请输入用户名"/>
								<label class="input__label input__label--hideo" for="forget-username">
									<i class="fa fa-fw fa-user icon icon--hideo"></i>
									<span class="input__label-content input__label-content--hideo"></span>
								</label>
							</span>
							
							<span class="input input--hideo">
								<input name="pleasePassword" class="input__field input__field--hideo" type="password" id="forget-password" placeholder="请重置密码" onblur="toCheckPasswordForget()"/>
								<label class="input__label input__label--hideo" for="forget-password">
									<i class="fa fa-fw fa-lock icon icon--hideo"></i>
									<span class="input__label-content input__label-content--hideo"></span>
								</label>
							</span>
							
							<span id="questionspan">
							    请输入正确的用户名以查看密保问题
							</span>
							<span id="questioninput">
							    <input type="text" id="answerinput" onblur="toCheckAnswer()"><br>
							    <span id="yesorno"></span>
							</span>
							<span id="yesorno"></span>
							
						</section>
					</div>
					<div class="form-actions">
						<a class="btn pull-left btn-link text-muted" onClick="goto_login()">返回登录</a>
						<input class="btn btn-primary" type="submit" onClick="forget()" value="重置密码" 
							style="color:white;"/>
					</div>
				</form>
			</div>
			
			
			
			
			<!-- 注册页面 -->
		
			<div class="login sign-up-htm" >
				<form method="post" class="container offset1 loginform" id="regis" method="post" action="<%=path%>/RegisterServlet?method=toRegisterNewCount">
					<!-- 猫头鹰控件 -->
					<div id="owl-login" class="register-owl">
						<div class="hand"></div>
						<div class="hand hand-r"></div>
						<div class="arms">
							<div class="arm"></div>
							<div class="arm arm-r"></div>
						</div>
					</div>
					
					 
		   	
					<div class="pad input-container">
						<section class="content">
							<span class="input input--hideo">
								<input class="input__field input__field--hideo" type="text" id="register-username" 
									autocomplete="off" placeholder="请输入用户名" maxlength="15" onblur="toCheckPassname()" name="username"/>
								<label class="input__label input__label--hideo" for="register-username">
									<i class="fa fa-fw fa-user icon icon--hideo"></i>
									<span class="input__label-content input__label-content--hideo"></span>
								</label>
							</span>
							
							<span id="chongfu"></span>
							
							<span class="input input--hideo">
								<input class="input__field input__field--hideo" type="password" id="register-password" placeholder="请输入密码" 
								     maxlength="12" onblur="toCheckPassword()" name="userpass"/>
								<label class="input__label input__label--hideo" for="register-password">
									<i class="fa fa-fw fa-lock icon icon--hideo"></i>
									<span class="input__label-content input__label-content--hideo"></span>
								</label>
							</span>
							
							
							
							<span class="input input--hideo">
								<input class="input__field input__field--hideo" type="password" id="register-repassword" placeholder="请再次输入密码" maxlength="12" onblur="toCheckPassword()"/>
								<label class="input__label input__label--hideo" for="register-repassword">
									<i class="fa fa-fw fa-lock icon icon--hideo"></i>
									<span class="input__label-content input__label-content--hideo"></span>
								</label>
							</span>
							
							
							
							<!-- 显示更多 -->
						    <span id="xianshiyincang" style="font-size:20px;" onmouseover="xianShi()" >显示更多</span><br>
						    
						    <!-- 显示出的span -->
						    <span id="showMore" style="display:none;position:absolute;top:0px;left:400px;width:400px;height:440px;background-color:#bff6f3;" >
						                    <br><br>
						                    性别：<input type="radio" name="usersex" value="true" checked>男<input type="radio" name="usersex" value="false" />女<br><br>
						                    真实姓名：<input type="text" maxlength="5" id="realname" name="userRealName" ><span style="color:red;">*必填项</span><br><br>
						                    手机号：<input type="text" maxlength="15" id="phonenumber" name="userphone" ><span style="color:red;">*必填项</span><br><br>
						                    昵称：<input type="text" maxlength="10" id="nickname" name="usernickname" ><span style="color:red;">*必填项</span><br><br>
						                    密保问题：<select name="userquestion">
						                    <option value="1">你的高中班主任的名字？</option>
						                    <option value="2">你在哪个城市上的大学？</option>
						                    <option value="3">你的母亲叫什么名字？</option>
						                    <option value="4">你的父亲叫什么名字？</option>
						                    <option value="5">你最喜欢明星的名字？</option>
						                    <option value="6">你上过的的小学叫什么名字？</option>
						                    <option value="7">你家所在的区的名字？</option>
						                </select>
						                <br><br>
						                     答案：<input type="text" maxlength="10" id="answerQuestion" onblur="toCheckInfo()" name="useranswer" ><span style="color:red;">*必填项</span><br>
						                <span id="tianxie"></span><br>

						          <span>
						                                验证码：<input type="text" name="checkCode2" id="inputCheckCode2" v="" maxlength="4" onkeyup="toCheckTheCode2()"><span></span>
							         <img id="thecode2" src="<%=path%>/CheckCodeServlet?method=createCheckCode"><br>
							         <a href="javascript:void(0);" id="changeCode2" onclick="toChangeCheckcode2()">换一张</a><br><br>
							         
							         <script type="text/javascript">
							         <!-- 换一张验证码 -->
							         function toChangeCheckcode2()
							         {
							    		   var m = Math.random();
							    		 //当点击“换一张”，更换验证码图片
							    		 $("#thecode2").attr("src","<%=path%>/CheckCodeServlet?method=createCheckCode&x="+m);
							         }
							         </script>
							  
							         <!-- 判断输入的验证码与图片中的验证码是否相同 -->
                                     <script type="text/javascript">
                                     function toCheckTheCode2()
                                     {
                            	          $("#inputCheckCode2").attr("v","");
                                		  //验证码输入不足四位的时候，不判断
                                   		  if($("#inputCheckCode2").val().length<4)
                                		  {
                                   			
                                			return;
                                		  }
                                   		
                                   		  var y = $("#inputCheckCode2").val();//获得文本框中输入的内容
                                   		
                                   		  $.ajax({
                                   			  url:"<%=path %>/CheckCodeServlet",
                                   			  type:"post",
                                   			  data:"method=check&inputcode="+y,
                                   			  success:function(mes){
                                   				if(mes=="yes")
                                				{
                                					$("#inputCheckCode2").next().html("验证码输入正确");
                                					$("#inputCheckCode2").next().css("color","green");
                                					$("#inputCheckCode2").attr("v","yes");
                                				}
                                				if(mes=="no")
                                				{
                                					$("#inputCheckCode2").next().html("验证码输入错误");
                                					$("#inputCheckCode2").next().css("color","red");
                                					
                                				}
                                   			  }
                                   		  })
                              }
                              </script>
							         
						          </span>
						         
						          <a href="javascript:void(0);" onclick="yinCang()">隐藏</a>
						    </span>
						    
						    
						   
						    
						</section>
					</div>
					<div class="form-actions">
						<a class="btn pull-left btn-link text-muted" onClick="goto_login()">返回登录</a>
						<input class="btn btn-primary" type="submit"  value="注册" 
							style="color:white;"/>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>